package com.ishare.common.exception;


import com.ishare.common.errorcode.IErrorCode;

/**
 * @description: 自定义异常
 * @author: DENGMINGWEN
 * @time: 2021/3/4 16:11
 */
public class BusinessException extends RuntimeException {
    /**
     * 异常码
     */
    protected IErrorCode errorCode;

    public BusinessException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message, Throwable cause) {

        super(message, cause);
    }

    public IErrorCode getErrorCode() {
        return errorCode;
    }
}
